enum MethodType {
  CHECKINSTALLAPPS,
  GETSCANCODE,
  GOCONTACTRESFORALLINFO,
  GOCONTACTRES,
  GETPHONESBYNUMBER,
  ONCLICK4JS,
  GETVBPAYRESIMAGE,
  SHAREBYSDK,
  HIDEKEYBOARD
}

class MenuInfo {
  String title;
  String funcName;
  MethodType type;

  MenuInfo(this.title, this.funcName, this.type);
}

class MenuListProvider {
  static final MenuListProvider instance = MenuListProvider._internal();

  MenuListProvider._internal();

  Future<List<MenuInfo>> getMenuList() async {
    var titles = <MenuInfo>[];
    await new Future.delayed(const Duration(milliseconds: 10)); // 当前线程休眠5s
    titles.add(MenuInfo(
        "检测一个app 是否安装", "checkInstallApps", MethodType.CHECKINSTALLAPPS));
    titles.add(MenuInfo("生成条形码", "getScanCode", MethodType.GETSCANCODE));
    titles.add(MenuInfo("弹出原生通讯录选择电话", "goContactResForAllInfo",
        MethodType.GOCONTACTRESFORALLINFO));
    titles.add(MenuInfo(
        " 调用获取通讯录列表 获得一个手机号", "goContactRes", MethodType.GOCONTACTRES));
    titles.add(MenuInfo(
        "根据输入的手机号获取通讯列表", "getPhonesByNumber", MethodType.GETPHONESBYNUMBER));
    titles.add(MenuInfo("调用原生安全键盘", "onClick4Js", MethodType.ONCLICK4JS));
    titles
        .add(MenuInfo("生成截屏", "getVBPayResImage", MethodType.GETVBPAYRESIMAGE));
    titles.add(MenuInfo("分享", "shareBySDK", MethodType.SHAREBYSDK));
    titles.add(MenuInfo("安卓键盘收起", "hideKeyBoard", MethodType.HIDEKEYBOARD));
    return titles;
  }

  Future<List<MenuInfo>> getMenuList2() async {
    await new Future.delayed(const Duration(milliseconds: 10)); // 当前线程休眠5s
    var titles = <MenuInfo>[
      MenuInfo("检测一个app 是否安装", "checkInstallApps", MethodType.CHECKINSTALLAPPS),
      MenuInfo("生成条形码", "getScanCode", MethodType.GETSCANCODE),
      MenuInfo("弹出原生通讯录选择电话", "goContactResForAllInfo",
          MethodType.GOCONTACTRESFORALLINFO),
      MenuInfo(" 调用获取通讯录列表 获得一个手机号", "goContactRes", MethodType.GOCONTACTRES),
      MenuInfo(
          "根据输入的手机号获取通讯列表", "getPhonesByNumber", MethodType.GETPHONESBYNUMBER),
      MenuInfo("调用原生安全键盘", "onClick4Js", MethodType.ONCLICK4JS),
      MenuInfo("生成截屏", "getVBPayResImage", MethodType.GETVBPAYRESIMAGE),
      MenuInfo("分享", "shareBySDK", MethodType.SHAREBYSDK),
      MenuInfo("安卓键盘收起", "hideKeyBoard", MethodType.HIDEKEYBOARD)
    ];
    return titles;
  }
}
